package com.iqiyi.pps.epg.core.service.record;

import com.iqiyi.pps.epg.api.model.web.query.TFilter;
import com.iqiyi.pps.epg.api.model.web.query.TPage;
import com.iqiyi.pps.epg.api.model.web.record.*;
import com.iqiyi.pps.epg.core.model.record.*;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;

import java.util.List;

/**
 * Created by karkarrotxu on 2018/4/11.
 */
public interface IRecordService {
    // plan  start;
    public long saveRecordPlan(RecordPlan entity);
    public void editRecordPlan(RecordPlan entity);
    public TRecordPlanPage findPlanPage (TPage page, TFilter filter);
    public TRecordPlanLibraryPage findPlanLibraryPage(TPage page, TFilter filter);
    public RecordPlan getRecordPlanById( long entityId);
    public TRecordPlan transToTRecordPlan( RecordPlan entity);
    public List<RecordPlan> queryPlanByCriterion(List<Criterion> list, List<Order> orderList);

    public TRecordChannelSimplePage findChannelSimplePage( TPage page, TFilter filter );

    public TRecordColSimplePage findColSimplePage( TPage page, TFilter filter );

    public void updateBatchRecordPlan(List<RecordPlan> plans);
    // plan end;

    //plan task start
    public void editRecordTask(RecordTask entity);
    public TRecordTaskDataPage findTaskDataPage (TPage page, TFilter filter);
    public TRecordTaskLibraryPage findTaskLibraryPage(TPage page, TFilter filter);
    public RecordTask getRecordTaskById( long entityId);
    public List<RecordTask> queryTaskByCriterion(List<Criterion> list, List<Order> orderList);
    public List<RecordTask> queryTaskByCriterion(List<Criterion> list, List<Order> orderList,int maxResultNum);
    public List<RecordTask> queryTaskByCriterion(List<Criterion> list, List<Order> orderList,int maxResultNum,int first);
    public void saveBatchRecordTask(List<RecordTask> list );
    public void updateBatchRecordTask(List<RecordTask> list );
    public List<RecordTask> queryRecordTaskForGetVideo();
    public void doClearTaskBefore(long planId, long newStartTime);
    //plan task end

    public long saveRecordChannel(RecordChannel entity);
    public void editRecordChannel(RecordChannel entity);
    public RecordChannel getRecordChannelById(long entityId);
    public TRecordChannelPage findChannelPage( TPage page, TFilter filter );
    public void delRecordChannel(long channelId);


    // taks rule start
    public List<RecordTaskRule> queryTaskRuleByCriterion(List<Criterion> list, List<Order> orderList);
    public long saveRecordTaskRule(RecordTaskRule entity);
    public void editRecordTaskRule(RecordTaskRule entity);
    public int changeTaskRuleStatus(long planId, int execStatusNew, int execStatusOld) ;
    public RecordTaskRule getRecordTaskRuleByPlanId(long planId);
    public RecordTaskRule getRecordTaskRuleById(long entityId);
    // taks rule end

    //---------signal--------------//
    public TRecordSignalPage findSignalPage (TPage page, TFilter filter);
    public long saveRecordSignal(RecordSignal entity);
    public void editRecordSignal(RecordSignal entity);
    public RecordSignal getRecordSignalById( long entityId);
    public TRecordSignal transToTRecordSignal( RecordSignal entity);

    public TRecordChannelSignalPage findChannelSignalPage (TPage page, TFilter filter);
    public long saveRecordChannelSignal(RecordChannelSignal entity);
    public boolean delRecordChannelSignal(long id);
    public void editRecordChannelSignal(RecordChannelSignal entity);
    public RecordChannelSignal getRecordChannelSignalById( long entityId);
    public List<RecordChannelSignal> getRecordChannelSignalBySignalId( long signalId);
    public TRecordChannelSignal transToTRecordChannelSignal(long recordChannelSignalId);
    public TRecordChannelSignal getTRecordChannelSignal(long recordChannelSignalId);
    public TRecordChannelSignalTablePage findRecordChannelSignalTablePage(TPage page, TFilter filter);
    public void updateRecordChannelSignalStatus(long signalId,long status);

    public int getServerAvailableIncluding(long recordChannelSignalId, String serverIp);
    public List<RecordChannelSignal> queryChannelSignalByCriterion(List<Criterion> list, List<Order> orderList);
    // record_col start
    public List<RecordCol> queryColByCriterion(List<Criterion> list, List<Order> orderList);
    public void updateBatchRecordCol(List<RecordCol> list );
    // record_col end

    //record video start
    public void saveRecordVideo(RecordVideo entity);
    public RecordVideo updateRecordVideoStatus(long signalId,long taskId, long videoId, int videoStatus);
    public RecordTask updateRecordTaskStatus(long taskId,  int taskStatus);

    public void deleteVideoByChannel(long channelId);

    public void deleteVideoByTask(long taskId);

    public void deleteVideoByTasks(String taskIds);


    //record video end
}
